﻿namespace ChessToys.QueensProblem.Cli
{
    using System;

    public class Timer
    {
        private DateTime _start;

        public Timer()
        {
            Reset();
        }

        public void Reset()
        {
            _start = DateTime.Now;
        }

        public TimeSpan Duration
        {
            get { return DateTime.Now - _start; }
        }

        public override string ToString()
        {
            return String.Format("{0:T}", Duration);
        }
    }
}
